package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        /*
        //绝对路径
        File f1 = new File("C:/Users/tedu/IdeaProjects/jsd2408/demo.txt");
        //相对路径
        File f2 = new File("./demo.txt");

         */

        File fi = new File("./demo.txt");
        System.out.println("文件的名字叫:"+fi.getName());
        System.out.println("文件的大小:"+fi.length()+"个字节");
        System.out.println("文件是否可读:"+fi.canRead());
        System.out.println("文件是否可写:"+fi.canWrite());
        System.out.println("文件是否被隐藏:"+fi.isHidden());
    }
}
